﻿using System;
using System.Collections.Generic;
 
using System.Text;
 
using AuditUpload.gui;
using System.Data;

namespace AuditUpload.model
{
    public class Global
    {
        public static List<linkLabel> labeltoShow;
        public static databaseLink sourcelink { get; set; }
        public static int temptargetRowNum { get; set; }
        //public static TransForm transFrame;
        public static int temptargetNum { get; set; }
        public static List<objTable> sourceTable; 
        public static List<objTable> targetTable;
        
        public static TotalSet totalSet { get; set; }
        public static user userDatas { get; set; }
        public static int datacount { get; set; }

      

        public static void datatypeList(System.Windows.Forms.ListBox list)//从列表添加支持的数据库
        {    
            System.Data.DataTable table = new System.Data.DataTable();
            table.Columns.Add("id");
            table.Columns.Add("name");
            DataRow row;
            row = table.NewRow();
            row["id"] = (int)databasetype.Oracle;
            row["name"] = "Oracle";
            table.Rows.Add(row);

            row = table.NewRow();
            row["id"] = (int)databasetype.SqlServer;
            row["name"] = "SqlServer";
            table.Rows.Add(row);

            /*row = table.NewRow();
            row["id"] = (int)databasetype.Excel;
            row["name"] = "Excel";
            table.Rows.Add(row);*/


            list.DisplayMember = "name";
            list.ValueMember = "id";
            list.DataSource = table;
            //table.Dispose();
            //table = null;
        }
    }
    public enum databasetype//支持的数据库类型
    {
        Oracle,
        SqlServer,
        //Excel,
    }
    public enum progress//进度
    {
        login,
        logindatabase,
        sourceDetail,
        download,
        missfile,
        upload,
    }
}
